Repository navigation
Conversation
Fill unused single-query result slots with the missing ID and distance sentinels. Keep batch output lengths strict and validate the native ID and distance counts before writing the output buffers. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-6 AI-Contributed/Feature: 68/68 AI-Contributed/UT: 0/0
|
PR #124 already covers padding for underfull single-query results. The C regression test added there requests three results, matches two rows, and checks that the last slot contains Could you share a minimal test case that reproduces the issue through the public C API on the current |
|
I traced the public single-query entry points again. The IVF wrapper pads to K, and DiskANN also pads its underfull results before the FFI copy. The C test in #124 already checks the two-hits-for-three case, including both sentinels. My added test only invokes the private copy helper with a short slice. I don't have a public C API reproducer on main or evidence that a second padding layer is needed here. Thanks for pointing me to the existing coverage. The downstream result adapter skips row ID -1 before converting scores. I also compiled its shared-searcher FFI path with the strict copy helper from main. The deployed downstream build available to me predates #124, so an end-to-end run of the upgrade is still outstanding. I will keep this open until that check is complete. |
|
StarRocks verification is still in progress. The shared-searcher build passed with the strict result-length check from main. The remaining check is an end-to-end query that requests more neighbors than match, using #124 without the patch in this PR. If StarRocks returns the matching rows and scores correctly, I’ll close this PR and #134. |
Closes #134.
A single query can return fewer matches than requested. Preserve those matches in the caller’s fixed-size output buffers and fill the unused tail with the existing ID and distance sentinels. Only the unused slots are padded.
All single-query entry points, including filtered searches, use this behavior. Batch calls still require a complete result matrix. The C signatures and on-disk format are unchanged.
Validation
Added cases for two returned hits with four requested slots, and for a short batch result.
Local checks passed with
cargo fmt --all -- --checkandcargo build --locked -p paimon-vindex-ffi --lib. Tests are left to upstream CI.